package com.quectel.sdk.hikisc.basemodel.event;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.quectel.sdk.hikisc.basemodel.EventBaseDataResp;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.util.List;

/**
 * 人脸抓拍事件数据
 *
 * @author: rananxin
 * @email: ryan.ran@quectel.com
 * @date: 2022-10-21 14:57:00
 */
@Data
@EqualsAndHashCode(callSuper=true)
public class EventFaceData extends EventBaseDataResp.EventDataCls {

    /**
     * data
     */
    private DataCls data;
    /**
     * eventId
     */
    private String eventId;
    /**
     * eventType
     */
    private Integer eventType;
    /**
     * happenTime
     */
    @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXX", timezone = "GMT+8")
    private Date happenTime;
    /**
     * srcIndex
     */
    private String srcIndex;
    /**
     * srcType
     */
    private String srcType;
    /**
     * status
     */
    private Integer status;
    /**
     * timeout
     */
    private Integer timeout;

    /**
     * DataCls
     */
    @NoArgsConstructor
    @Data
    public static class DataCls {
        /**
         * captureLibResult
         */
        private List<CaptureLibResultCls> captureLibResult;
        /**
         * channelID
         */
        private Integer channelID;
        /**
         * dataType
         */
        private String dataType;
        /**
         * ipAddress
         */
        private String ipAddress;
        /**
         * portNo
         */
        private Integer portNo;

        /**
         * CaptureLibResultCls
         */
        @NoArgsConstructor
        @Data
        public static class CaptureLibResultCls {
            /**
             * faces
             */
            private List<FacesCls> faces;
            /**
             * targetAttrs
             */
            private TargetAttrsCls targetAttrs;

            /**
             * TargetAttrsCls
             */
            @NoArgsConstructor
            @Data
            public static class TargetAttrsCls {
                /**
                 * bkgUrl
                 */
                private String bkgUrl;
                /**
                 * cameraIndexCode
                 */
                private String cameraIndexCode;
                /**
                 * deviceIndexCode
                 */
                private String deviceIndexCode;
                /**
                 * faceTime
                 */
                @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXX", timezone = "GMT+8")
                private Date faceTime;
                /**
                 * picServerIndexCode
                 */
                private String picServerIndexCode;
                /**
                 * rect
                 */
                private RectCls rect;

                /**
                 * RectCls
                 */
                @NoArgsConstructor
                @Data
                public static class RectCls {
                    /**
                     * height
                     */
                    private Double height;
                    /**
                     * width
                     */
                    private Double width;
                    /**
                     * x
                     */
                    private Double x;
                    /**
                     * y
                     */
                    private Double y;
                }
            }

            /**
             * FacesCls
             */
            @NoArgsConstructor
            @Data
            public static class FacesCls {
                /**
                 * url
                 */
                private String url;
                /**
                 * age
                 */
                private AgeCls age;
                /**
                 * faceRect
                 */
                private FaceRectCls faceRect;
                /**
                 * faceScore
                 */
                private FaceScoreCls faceScore;
                /**
                 * gender
                 */
                private GenderCls gender;
                /**
                 * glass
                 */
                private GlassCls glass;

                /**
                 * AgeCls
                 */
                @NoArgsConstructor
                @Data
                public static class AgeCls {
                    /**
                     * ageGroup
                     */
                    private String ageGroup;
                }

                /**
                 * FaceRectCls
                 */
                @NoArgsConstructor
                @Data
                public static class FaceRectCls {
                    /**
                     * height
                     */
                    private Double height;
                    /**
                     * width
                     */
                    private Double width;
                    /**
                     * x
                     */
                    private Double x;
                    /**
                     * y
                     */
                    private Double y;
                }

                /**
                 * FaceScoreCls
                 */
                @NoArgsConstructor
                @Data
                public static class FaceScoreCls {
                    /**
                     * enable
                     */
                    private String enable;
                    /**
                     * totalScore
                     */
                    private Integer totalScore;
                    /**
                     * type
                     */
                    private Integer type;
                }

                /**
                 * GenderCls
                 */
                @NoArgsConstructor
                @Data
                public static class GenderCls {
                    /**
                     * value
                     */
                    private String value;
                }

                /**
                 * GlassCls
                 */
                @NoArgsConstructor
                @Data
                public static class GlassCls {
                    /**
                     * value
                     */
                    private String value;
                }
            }
        }
    }
}
